(function(){
	var data={
		api:['',''],
		ad:{}
	};
	var basic={
		element:function(A,B,C){
			var A=document.createElement(A);
			if(typeof C=='function'){A.onload=C;}
			if(typeof B=='object'){
				for(k in B){
					if(typeof B[k]=='string'){
						if(k=='style'){
							A.style.cssText=B[k];
						}else{
							A.setAttribute(k,B[k]);
						}
					}
				}
			}
			return A;
		},
		serialize:function(A){
			var B='';
			if(typeof A=='object'){
				for(k in A){
					B+=k+'='+encodeURIComponent(A[k])+'&';
				}
				B=B.slice(0,-1);
			}
			return B;
		},
		script:function(A,B,C){
			if(C){B['nocache']=Math.random().toString();}
			A+=A.indexOf('?')===-1?'?':'&'+this.serialize(B);
			var D=this.element('script',{type:'text/javascript',src:A,charset:'utf-8'});
			var E=document.getElementsByTagName('head')[0];
			E.appendChild(D);
		},
		get:function(A){
			return document.getElementById(A);
		},
		remove:function(A,B){
			if(typeof B=='string'){
				A=this.get(A);
				B=this.get(B);
			}else{
				B=this.get(A);
				A=document.getElementsByTagName('body');
			}
			return A.removeChild(B);
		},
		insert:function(A,B){
			if(!B){
				B=document.getElementsByTagName('body');
				if(!B){
					this.insert(this.element('body'),document);
				}
			}
			return B.appendChild(A);
		},
		cookie:function(name,value,expires){
		   var A=document.cookie.split("; "),B={},C=[];
		   for(var i=0;i<A.length;i++){
		      C=B[i].split("=");
		      B[C[0]]=unescape(C[1]);
		   }
		   if(value){
			   	if(value==true){
			   		document.cookie=name+"=;expires="+(new Date(0)).toGMTString();
			   }else{
			   		if(!expires){expires=0;}
				    var exp=new Date();exp.setTime(exp.getTime()+expires*1000);
				    document.cookie=name+"="+escape(value)+";expires="+exp.toGMTString();
			   }
		   }
		   return B[name];
		}
	};
	var client={
		domain:location.hostname,
		href:window.top.location.href,
		referrer:function(){
			var A='';
			if(document.referrer.length>0){
				return document.referrer;
			}else{
				try{
					if(opener.location.href.length>0){
						return opener.location.href;
					}else{
						return false;
					}
				}catch(e){
					return false;
				}
			}
		},
		agent:navigator.userAgent.toString().toLowerCase().replace(/\s+/g,''),
		language:function(){
			return (navigator.systemLanguage||navigator.language).toLowerCase();
		},
		browser:function(){
			var A={'mobile':/mobile([\d.]+)/,'maxthon':/maxthon\D*([\d.]+)/,'theworld':/theworld/,'360':/360/,
				   'tencent':/tencent/,'sougou':/se1.x/,'avant':/avant/,'ie':/msie([\d.]+)/,'firefox':/firefox\/([\d.]+)/,
				   'opera':/opera.([\d.]+)/,'chrome':/chrome\/([\d.]+)/,'safari':/version\/([\d.]+).*safari/};
			var B={'browser':'none','version':0},C=null;
			for(key in A){
				C=this.agent.match(A[key]);
				if(C!=null){
					B['browser']=key;B['version']=parseInt(C[1]);
					break;
				};
			}
			return B;
		},
		os:function(){
			var A=navigator.platform.toString().toLowerCase();
			if(A=='win32'||A=='windows'){
				if(this.agent.indexOf('windowsnt5.0')>-1||this.agent.indexOf('windows2000')>-1){
					return 'w2000';
				}else if(this.agent.indexOf('windowsnt5.1')>-1||this.agent.indexOf('windowsxp')>-1){
		        	return 'wxp';
		        }else if(this.agent.indexOf('windowsnt5.2')>-1||this.agent.indexOf('windows2003')>-1){
		        	return 'w2003';
		        }else if(this.agent.indexOf('windowsnt6.0')>-1||this.agent.indexOf('windowsvista')>-1){
		        	return 'wvista';
		        }else if(this.agent.indexOf('windowsnt6.1')>-1||this.agent.indexOf('windows7')>-1){
		        	return 'w7';
		        }else{
		        	return A;
		        }
			}else if(A=='mac68k'||A=='macppc'||A=='macintosh'||A=='macintel'||A=='ipad'){
				return 'apple';
			}else if(A=='x11'){
				return 'unix';
			}else if(this.agent.indexOf('linux')!=-1){
				return 'linux';
			}
		},
		screen:function(){
			return {'width':screen.width,'height':screen.height};
		},
		keyword:function(){
			var A=this.referrer.replace(/^[^\?]+\??/,'');
		   	A+='&'+this.href.replace(/^[^\?]+\??/,'');
		   var B=A.split(/[;&]/);
		   var P={};
		   for(var i=0;i<B.length;i++){
		      var K=B[i].split('=');if (!K||K.length!=2){continue;}
		      var key=K[0]; var val=K[1];
		      val=val.replace(/\+/g,' ');P[key]=val;
		   }
		   var SW={Q1:true,NAME:true,KEYWORD:true,KEY:true,BS:true,Q:true,OP:true,QUERY:true,P:true,KWID:true,WD:true,WORD:true,KW:true,W:true};
		   var KW='';
		   for(key in P){if(SW[key.toUpperCase()]){KW=P[key]==''?KW:P[key];}}
		   return KW==''?'':KW;
		}
	};
	window.cnadlm={
		M:'',
		V:'',
		go:function(){
			var send={};
			send['domain']=client.domain;send['href']=client.href;
			send['referrer']=client.referrer();send['language']=client.language();
			send['browser']=client.browser();send['version']=send.browser['version'];send['browser']=send.browser['browser'];
			send['system']=client.os();send['screen']=client.screen();send['screen']=send.screen.width*100000+send.screen.height;
			send['keyword']=client.keyword();
			data.ad[V]=M;
			basic.script(data.api,send,true);
		},
		materiel:function(A,B,C){
			var R=null;
			switch(A){
				case 'image':
					R=basic.insert(basic.element('img',{src:B,style:'cursor:pointer;border-width:0px;'}),basic.element('a',{href:C,target:'_blank',style:'border-width:0px;'}));
				break;
				case 'swf':
					R=basic.element('div',{style:'width:100%;height:100%;border-width:0px;position:relative;z-index:999;'});
			        var browser=client.browser();
			        if(browser.browser=='ie'){
			            R.innerHTML='<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="100%" height="100%" align="middle"><param name="allowScriptAccess" value="always" /><param name="allowFullScreen" value="false" /><param name="movie" value="'+B+'" /><param name="loop" value="false" /><param name="menu" value="false" /><param name="quality" value="best" /><param name="bgcolor" value="#ffffff" /><param name="wmode" value="transparent"/></object>';
			        }else{
			            R.innerHTML='<embed src="'+B+'" loop="false" menu="false" quality="best" bgcolor="#ffffff" width="100%" height="100%" name="_adu" align="middle" allowScriptAccess="always" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" wmode="transparent" />';
			        }
					var A=basic.element('a',{href:C,target:'_blank',style:'width:100%;height:100%;border-width:0px;display:block;position:absolute;left:0px;top:0px;'});
					R=basic.insert(A,R);
				break;
				case 'html':
				break;
			}
			return R;
		},
		moving:function(A,B,C,D){//浮标广告
			var func=function(){
				A=A.split('*');
				var sign=Q.N();
				var div=Q.D('div',{id:sign,style:'width:100%;height:auto;position:absolute;left:0px;top:10px;z-index:2147483647;'});
				var center=Q.D('div',{style:'width:'+A[0]+'px;height:'+A[1]+'px;margin:auto;position:relative;'});
				var msg=Q.D('div',{style:'width:153px;height:20px;padding-top:5px;text-align:center;position:absolute;right:0px;z-index:1000;background-color:#555;filter:alpha(opacity=60);opacity:0.6;'});
				var time=Q.D('div',{style:'width:123px;height:20px;float:left;color:#FFF;font-size:12px;font-weight:bold;'});
				var close=Q.D('a',{href:'#',style:'width:30px;height:20px;display:block;float:right;color:#FFF;font-size:12px;font-weight:bold;'});
				close.innerHTML='关闭';
				close.onclick=function(){Q.M(sign);return false;}
				msg[F.J](time);msg[F.J](close);
				center[F.J](msg);
				center[F.J](Q.L(B,C,D));//创建素材
				div[F.J](center);
				Q.I(div);
				var T=10;
				(function(){time.innerHTML="广告剩余时间:"+T+"秒";T>0?(setTimeout(arguments.callee,1000)):(Q.M(sign));T-=1;})();
			};
			if(B=='img'||B=='iframe'){Q.D(B,{src:C},func);}else{func();}
		},
		bottom:function(A,B,C,D){
			A=A.split('*');
			var sign=Q.N();
			var div=Q.D('div',{id:sign,style:'width:'+A[0]+'px;height:'+A[1]+'px;position:absolute;z-index:2147483647;right:0px;bottom:0px;'});
			var close=Q.D('a',{href:'#',style:'width:30px;height:16px;padding-top:3px;text-align:center;display:block;position:absolute;right:0px;color:#FFF;font-size:12px;font-weight:bold;background-color:#555;filter:alpha(opacity=60);opacity:0.6;'});
			close.innerHTML='关闭';
			close.onclick=function(){Q.M(sign);return false;}
			div[F.J](close);
			div[F.J](Q.L(B,C,D));//创建素材
			Q.I(div);
			(function(){
				if(!div){return false;}
				var W=F.E.scrollTop|F.L.scrollTop|F.A.pageYOffset;
				if(Q.B.C[F.I]('ie')!=-1){
					if(Q.B.D[F.I]('6')!=-1){
						div.style.bottom="-1px";div.style.bottom="0px";
						setTimeout(arguments.callee,300);
						return true;
					}
				}
				div.style.bottom=-W+"px";
				setTimeout(arguments.callee,300);
			})();
		},
		flotage:function(A,B,C,D){
			var U=new Array();
			var E=function(){
				U[0]=F.A.scrollTop|F.A.pageYOffset;
				U[1]=F.A.scrollLeft|F.A.pageXOffset;
				if(self.innerHeight){
				  U[2]=self.innerWidth;U[3]=self.innerHeight;
				}else if(F.L&&F.L.clientHeight){
				  U[2]=F.L.clientWidth;U[3]=F.L.clientHeight;
				}else if(F.E){
				  U[2]=F.E.clientWidth;U[3]=F.E.clientHeight;
				}
			};E();
			A=A.split('*');A[0]=parseInt(A[0]);A[1]=parseInt(A[1]);
			var sign=Q.N();
			var div=Q.D('div',{id:sign,style:'width:'+A[0]+'px;height:'+A[1]+'px;position:absolute;z-index:2147483647;left:'+Math.floor((U[1]+U[2]-A[0])*Math.random())+'px;top:'+Math.floor((U[0]+U[3]-A[1])*Math.random())+'px;'});
			var close=Q.D('a',{href:'#',style:'width:30px;height:16px;padding-top:3px;text-align:center;display:block;position:absolute;right:0px;color:#FFF;font-size:12px;font-weight:bold;background-color:#555;filter:alpha(opacity=60);opacity:0.6;'});
			close.innerHTML='关闭';
			close.onclick=function(){Q.M(sign);return false;}
			div[F.J](close);
			div[F.J](Q.L(B,C,D));
			Q.I(div);
			var T=null,LX=false,LY=true;
			div.M=function(){
				E();
				var L=parseInt(div.style.left.slice(0,-2))-U[1];var T=parseInt(div.style.top.slice(0,-2))-U[0];
				if ((L-1)<=0){LX=true;}else if((L+1)>=(U[2]-A[0])){LX=false;}
				if((T-1)<=0){LY=true;}else if((T+1)>=(U[3]-A[1]-20)){LY=false;}
				div.style.top=T+(LY?1:-1)+U[0]+"px";
				div.style.left=L+(LX?1:-1)+U[1]+"px";
			}
			T=setInterval(div.M,18);
			div.onmouseover=function(){clearInterval(T);}
	       	div.onmouseout=function(){T=setInterval(div.M,30);}
		},
		couplet:function(A,B,C,D){
			A=A.split('*');
			var lsign=Q.N();
			var ldiv=Q.D('div',{id:lsign,style:'width:'+A[0]+'px;height:'+A[1]+'px;position:absolute;z-index:2147483647;left:0px;top:130px;'});
			var lclose=Q.D('a',{href:'#',style:'width:30px;height:16px;padding-top:3px;text-align:center;display:block;position:absolute;bottom:0px;right:0px;color:#FFF;font-size:12px;font-weight:bold;background-color:#555;filter:alpha(opacity=60);opacity:0.6;'});
			lclose.innerHTML='关闭';
			ldiv[F.J](lclose);
			ldiv[F.J](Q.L(B,C,D));//创建素材
			Q.I(ldiv);
			var rsign=Q.N();
			var rdiv=Q.D('div',{id:rsign,style:'width:'+A[0]+'px;height:'+A[1]+'px;position:absolute;z-index:2147483647;right:0px;top:130px;'});
			var rclose=Q.D('a',{href:'#',style:'width:30px;height:16px;padding-top:3px;text-align:center;display:block;position:absolute;bottom:0px;left:0px;color:#FFF;font-size:12px;font-weight:bold;background-color:#555;filter:alpha(opacity=60);opacity:0.6;'});
			rclose.innerHTML='关闭';
			rdiv[F.J](rclose);
			rdiv[F.J](Q.L(B,C,D));//创建素材
			Q.I(rdiv);
			lclose.onclick=rclose.onclick=function(){Q.M(lsign);Q.M(rsign);return false;};
		},
		embed:function(A,B,C,D,E){
			A=A.split('*');
			var R=Q.L(B,C,D,A[0],A[1]);
			var script=F.D[F.M]('script');
			for(k in script){
				var CODE=script[k].innerHTML;
				if(typeof CODE=='string'){
					if(CODE[F.I](E)>-1){
						if(script[k].parentNode){
							script[k].parentNode.insertBefore(R,script[k]);
						}else{alert('error:5');}
						break;
					}
				}
			}
		}
	}
})();